import 'package:flutter_network/service_method.dart';
import 'package:wallet_utils/report_widget/base/callback/base_callback.dart';
import 'package:wallet_utils/report_widget/base/callback/net_request_utils.dart';

import '../bean/iconDetailBean.dart';
import 'hxh_url.dart';

class HXHApi {
  //查询用户状态 用于首页UI配置

  static checkUser(BaseCallback callback) async {
    return NetRequestUtils.request(
        future: HttpRequest().requestPost(
          HXHUrl.hxhCheckUser,
        ),
        callback: callback);
  }
  static getUserAllOrder(BaseCallback callback) async {
    return NetRequestUtils.request(
        future: HttpRequest().requestPost(
          HXHUrl.getUserAllOrder,
        ),
        callback: callback);
  }
  static getAuditResult(String orderNo, BaseCallback callback) {
    Map<String, dynamic> paramsMap = {
      "orderNo": orderNo,
    };
    return NetRequestUtils.request(
        future: HttpRequest().requestPost(
          HXHUrl.getAuditResult,
          params: paramsMap,
        ),
        callback: callback);
  }
  //订单状态查看
  static getOrderStatus(String orderNo, BaseCallback callback) {
    Map<String, dynamic> paramsMap = {
      "orderNo": orderNo,
    };
    return NetRequestUtils.request(
        future: HttpRequest().requestPost(
          HXHUrl.getOrderStatus,
          params: paramsMap,
        ),
        callback: callback);
  }
  //确认借款接口
  static confirmLoan(String orderNo, BaseCallback callback) {
    Map<String, dynamic> paramsMap = {
      "orderNo": orderNo,
    };
    return NetRequestUtils.request(
        future: HttpRequest().requestPost(
          HXHUrl.confirmLoan,
          params: paramsMap,
        ),
        callback: callback);
  }
  //获取还款页面接口
  static getRepayUrl(String orderNo, BaseCallback callback) {
    Map<String, String> paramsMap = {
      "orderNo": orderNo,
    };
    return NetRequestUtils.request(
        future: HttpRequest().requestPost(
          HXHUrl.getRepayUrl,
          params: paramsMap,
        ),
        callback: callback);
  }
  //试算接口
  static getTrialInfo(String orderNo, BaseCallback callback) {
    Map<String, dynamic> paramsMap = {
      "orderNo": orderNo,
    };
    return NetRequestUtils.request(
        future: HttpRequest().requestPost(
          HXHUrl.getTrialInfo,
          params: paramsMap,
        ),
        callback: callback);
  }
  //还款计划查询接口
  static getRepayPlan(String orderNo, BaseCallback callback) {
    Map<String, dynamic> paramsMap = {
      "orderNo": orderNo,
    };
    return NetRequestUtils.request(
        future: HttpRequest().requestPost(
          HXHUrl.getRepayPlan,
          params: paramsMap,
        ),
        callback: callback);
  }
}
